<!DOCTYPE html>
<!-- 1.2用模块：将模块名写在ng-app上 -->
<html lang="en" ng-app="test">
<head>
  <meta charset="UTF-8">
  <title>angular模块</title>
  <script src="angular.js"></script>
  <script>
    //1.1声明模块：module的第一个参数是模块名称，第二个参数是该模块依赖于哪些模块，是个数组
    let mod = angular.module('test',[]);
    //2.1写controller，一个模块中可以有多个controller
    mod.controller('ctrl1',function($scope){
      $scope.parseInt = function (str){
        return parseInt(str);
      }

    });
  </script>
</head>
<!-- 2.2用controller -->
<body  ng-controller="ctrl1">
    <input type="text" ng-model="a">
    <input type="text" ng-model="b">
    {{parseInt(a)+parseInt(b)}}
</body>
</html>